package com.atguigu.petstore.shop.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author lfy
 * @Description 商品发布vo
 * @create 2023-09-26 14:54
 */
@NoArgsConstructor
@Data
public class ProductPublishVo {

    @JsonProperty("productBaseInfo")
    private ProductBaseInfoDTO productBaseInfo;
    @JsonProperty("productImages")
    private ProductImagesDTO productImages;
    @JsonProperty("productEntry")
    private List<ProductEntryDTO> productEntry;

    @NoArgsConstructor
    @Data
    public static class ProductBaseInfoDTO {
        @JsonProperty("productName")
        private String productName;
        @JsonProperty("subTitle")
        private String subTitle;
        @JsonProperty("productImg")
        private String productImg;
        @JsonProperty("price")
        private BigDecimal price;
        @JsonProperty("weight")
        private BigDecimal weight;
        @JsonProperty("cateId")
        private Long cateId;
        @JsonProperty("stockCount")
        private Integer stockCount;
    }

    @NoArgsConstructor
    @Data
    public static class ProductImagesDTO {
        @JsonProperty("thumbnail")
        private List<String> thumbnail;
        @JsonProperty("detailImgs")
        private List<String> detailImgs;
    }

    @NoArgsConstructor
    @Data
    public static class ProductEntryDTO {
        @JsonProperty("id")
        private Long id;
        @JsonProperty("entryName")
        private String entryName;
        @JsonProperty("price")
        private BigDecimal price;
        @JsonProperty("stockCount")
        private Integer stockCount;
    }
}
